<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/5/8
 * Time: 上午10:01
 */

namespace App\Busi\Traits;


use App\Models\CompanyStaff;

Trait CompanyStaffTrait
{
    public function getStaffByCompanyId($company_id){
        $where = [
            ['company_id','=',$company_id]
        ];

        $data = CompanyStaff::where($where)->first();
        return $data;
    }
    public function getStaffByIdAndCompanyId($id,$company_id){
        $where = [
            ['id','=',$id],
            ['company_id','=',$company_id],
        ];

        $data = CompanyStaff::where($where)->first();
        return $data;
    }
}